package org.seed.rpc.core.routing;


/**
 * 相应终端
 */
public class Endpoint {

    public Endpoint() {

    }

    public Endpoint(String endpoint) {
        this.port = 31792;
        if (endpoint.contains(":")) {
            String[] arrEndpoint = endpoint.split(":");
            this.host = arrEndpoint[0];
            this.port = Integer.valueOf(arrEndpoint[1]);
        } else {
            this.host = endpoint;
        }
    }


    // ip
    private String host;

    // port
    private int port;

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

}
